package com.lq.learningTest.duoxiancheng;

public class Interrupt {
    public static void main(String[] args) {
        Thread t1 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("start");
                try {
                    Thread.sleep(600000);
                } catch (InterruptedException e) {
                   e.printStackTrace();
                }
                System.out.println("还在睡觉中");
                System.out.println("end");
            }
        });
        t1.start();

        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        t1.interrupt();
    }
}
